<template>
  <div class="banner">
    <el-carousel
      height="33.125rem"
      :indicator-position="'none'"
    >
      <el-carousel-item
        v-for="(item, index) in list"
        :key="index"
      >
        <img
          :src="item"
          alt=""
        >
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  name: "Banner",
  data() {
    return {
      list: [],
    };
  },
  mounted() {
  },
  methods: {
    getData(getData) {
      let param = {
        id: getData,
      };
      this.$api.home.topicbanner(param).then((res) => {
        if (res.code == 1) {
          console.log('获取热门专题banner',res)
          if(res.data===null) {
             this.list = []
          } else {
            this.list = res.data.pc_banner_images_arr;
          }
        } else {
          this.$message.error(res.msg);
        }
      });
    },
  },
};
</script>

<style scoped lang="scss">
.banner {
  //height: 530px;
  overflow: hidden;
  position: relative;
  margin-top: 6.18rem;
  img {
    width: 100%;
  }
}
</style>
